<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body background="../photo/IMG_20151101_140701_1447125580864.jpg">
<?php
echo "<H1 ALIGN=CENTER>连接数据库</H1>";
echo "<hr>";
   if(empty($_POST["sub"]))
   {
      if(empty($_POST["na"])||empty($_POST["nam"])||empty($_POST["name"]))
	  {
	     echo "<script>alert('地址或用户名或密码不能为空'),location='tijiao.php';</script>";
	  }
	  else
	  {
	     if(@mysql_connect($_POST[na],$_POST[nam],$_POST[name]))
		 {
		    echo "<script>alert('连接服务器成功'),location='index2.php';</script>";
		 }
		 else
		 {
		    echo "<script>alert('出错了'),location='tijiao.php';</script>";
		 }
	  }
   }
   else
   {
      echo "未知操作";
   }

?>
<a href="tijiao.php" title="返回首页">返回首页</a> 
</body>
</html>
